<%@ page language="java" import="java.util.*" import="com.sc.bean.GoodsBean" pageEncoding="utf-8"%>
<%
System.out.println("更新过了");
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%-- <%!public index_jsp() { --%>
<%-- 	super(); --%>
<%-- 	System.out.println("abc"); --%>
<%-- 	} %> --%>
	<%--<%myA();
	 System.out.println(basePath);--%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'index.jsp' starting page</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
  </head>
  
  <body>
   <%
   request.setCharacterEncoding("utf-8");
		response.setContentType("text/html");
		
		
		HttpSession s = request.getSession();
		//从我的柜子中取出购物车
		List<GoodsBean> sc = (List<GoodsBean>) s.getAttribute("sc");
		if(sc==null){
			sc = new ArrayList<GoodsBean>();
		}
		//resp
		out.println("<a href='/sc/goods.html'>逛逛商品</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='/sc/scart.html'>看看购物车</a>");
		out.println("<table border='1'>");
		out.println("<tr><td>商品编号</td><td>商品名称</td><td>商品价格</td><td>操作</td></tr>");
		out.println("");
		
		for (int i = 0; i < sc.size(); i++) {
			GoodsBean g = sc.get(i);%>
			<tr><td><%=g.getId()%></td><td><%=g.getName()%></td><td><%=g.getPrice() %></td><td>   <a href="DelScart.jsp?id=<%= g.getId()%>">移除购物车</a>  </td></tr>
		<%
		}
		out.println("</table>");
		
		
    %>>
  </body>
</html>
